<template>
	<view>
		<my-coupon-list :couponList="couponList" @itemClick="jumpNext"></my-coupon-list>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				couponList: []
			}
		},
		onLoad(opt) {
			this.$reqJsonPost("getUserCoupon", {id: opt.userId}).then(res=>{
				this.couponList = res.data.list
			})
		},
		methods: {
			jumpNext(item) {
				// console.log('jumpNext', item)
				uni.$emit('coupon', item)
				uni.navigateBack()
			}
		}
	};
</script>
<style lang="scss" scoped>

</style>